File processing method and mobile terminal

ABSTRACT

A file processing method includes obtaining a first operation from a user, displaying a first file on a first screen of a first application, obtaining a second operation from the user on the first screen, displaying, in response to the second operation, the first file on a recycle bin screen of the first application, deleting, by the mobile terminal, a first data table, where the first file is invisible to the user on the recycle bin screen of the first application due to deletion of the first data table, obtaining a third operation from the user, and generating, in response to the third operation, a second data table, where the first file is visible to the user on the recycle bin screen of the first application due to existence of the second data table.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a continuation of U.S. patent application Ser. No. 16/623,278,filed on Dec. 16, 2019, which is a U.S. National Stage of InternationalPatent Application No. PCT/CN2017/100854, filed on Sep. 7, 2017, whichclaims priority to Chinese Patent Application No. 201710459557.5 filedon Jun. 16, 2017. All of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of terminal application, and inparticular, to a file processing method and a mobile terminal.

BACKGROUND

As smartphones become popular and photographing functions of thesmartphones become increasingly powerful, more users use smartphones asa photographing tool and a storage medium for photos and videos.Therefore, large quantities of photos and videos are usually stored on amobile phone. When a user clears photos or performs other operations,some important photos may be mistakenly deleted. For an ordinary mobilephone, after a photo is deleted from an album, the photo is permanentlydeleted, and cannot be recovered by the user.

To prevent a photo from permanent loss because of a user's deletion bymistake, a recycle bin function is added to some mobile phones. Apicture or video deleted by a user is moved to a recycle bin, and afterthe photo or video is moved to the recycle bin, the photo or video isnot cleared until a period of time elapses. During this period of time,the user can recover the photo or video from the recycle bin to a sourcealbum.

SUMMARY

Embodiments of this application provide a file processing method and amobile terminal, to display a multimedia file on a recycle bin screenafter application data is cleared, so that a user can permanently deleteor recover the multimedia file on the recycle bin screen, therebyimproving user experience.

In view of this, a first aspect of this application provides a fileprocessing method, and the method includes: entering, by a user, a firstoperation on a mobile terminal, and in response to the first operation,displaying, by the mobile terminal, a first file on a first screen of afirst application; and entering, by the user, a second operation enteredby the user on the first screen, and in response to the secondoperation, skipping displaying, by the mobile terminal, the first fileon the first screen of the first application, and displaying the firstfile on a recycle bin screen; deleting, by mobile terminal, a first datatable of the first application, where the first file is invisible to theuser on the recycle bin screen of the first application due to deletionof the first data table, that is, the mobile terminal is unable todisplay the first file on the recycle bin screen; and after the mobileterminal deletes the first data table, entering, by the user, a thirdoperation on the mobile terminal, and in response to the thirdoperation, generating, by the mobile terminal, a second data table,where the first file is visible to the user on the recycle bin screen ofthe first application due to deletion of the second data table, that is,the mobile terminal is able to display the first file on the recycle binscreen.

The first data table and the second data table are recycle bin datatables, and are used to record metadata of a file belonging to a recyclebin. The first application displays, based on the recycle bin datatables, the file belonging to the recycle bin. The first data table isoriginally stored on the mobile terminal, and the second data table isgenerated after the first data table is deleted. Types of metadatarecorded in the two data tables may be the same or different.

In this embodiment, after the recycle bin data table is deleted, themobile terminal can generate a new recycle bin data table, so that themobile terminal can still display the first file on the recycle binscreen after application data is cleared, and the user can permanentlydelete or recover the first file on the recycle bin screen, therebyimproving user experience.

With reference to the first aspect of this application, in a firstimplementation of the first aspect of this application, before themobile terminal obtains the second operation entered by the user on thefirst screen, the first file belongs to a first album of the firstapplication; and after the mobile terminal obtains the second operationentered by the user on the first screen, the first file belongs to arecycle bin album of the first application.

After the mobile terminal displays the first file on the recycle binscreen, the user enters a fourth operation on the recycle bin screen torecover the first file. In response to the fourth operation, the mobileterminal changes an album to which the first file belongs from therecycle bin album to the first album, and the mobile terminal candisplay the first file on a screen corresponding to the first album.

In this embodiment, after application data is cleared, the user canrecover, on the recycle bin screen, the first file to a source album fordisplaying, thereby improving flexibility of the solution.

With reference to the first aspect of this application, in a secondimplementation of the first aspect of this application, before themobile terminal obtains the second operation entered by the user on thefirst screen, the first file belongs to a first album of the firstapplication; and after the mobile terminal obtains the second operationentered by the user on the first screen, the first file belongs to arecycle bin album of the first application.

After the mobile terminal displays the first file on the recycle binscreen, the user enters a fourth operation on the recycle bin screen torecover the first file. In response to the fourth operation, the mobileterminal changes an album to which the first file belongs from therecycle bin album to a target album, and the mobile terminal can displaythe first file on a screen corresponding to the target album.

The target album is a system- or user-specified album, and is used bythe user to manage a multimedia file recovered on the recycle binscreen.

In this embodiment, after application data is cleared, the user canrecover, on the recycle bin screen, the first file to a system-specifiedalbum for displaying, thereby improving flexibility of the solution.

With reference to the first aspect of this application, in a thirdimplementation of the first aspect of this application, after generatingthe second data table, the mobile terminal displays the first file onthe recycle bin screen of the first application, the user enters a fifthoperation on the recycle bin screen to permanently delete the firstfile. In response to the operation, the mobile terminal permanentlydeletes the first file, that is, deletes the first file from the mobileterminal. The first file is no long stored on the mobile terminal afterbeing permanently deleted.

In this embodiment, after application data is cleared, the user canpermanently delete the first file to release storage space, therebyimproving user experience.

With reference to the first aspect of this application, in a fourthimplementation of the first aspect of this application, after generatingthe second data table, the mobile terminal displays the first file onthe recycle bin screen of the first application. The user enters a sixthoperation on the recycle bin screen to view metadata of the first file.In response to the operation, the mobile terminal displays the metadataof the first file. The metadata may include at least one of thefollowing: an original filename of the first file, an original fileidentifier of the first file, a deletion time of the first file, asource storage path of the first file, a current storage path of thefirst file, a date taken time of the first file, a picture orientationof the first file, a cloud globally unique identifier of the first file,a hash value of the first file, and a cloud identifier of a source albumto which the first file belongs.

The original filename is a filename of the first file before the mobileterminal obtains the second operation. The original file identifier isan identifier, in a corresponding data table, of the first file beforethe mobile terminal obtains the second operation. The source storagepath is a storage path of the first file before the mobile terminalobtains the second operation. The current storage path is a storage pathof the first file when the mobile terminal obtains the sixth operation.The source album is an album to which the first file belongs before themobile terminal obtains the second operation.

In this embodiment, after application data is cleared, the user can viewthe metadata of the first file on the recycle bin screen to learndetails of the first file, thereby improving user experience.

With reference to any one of the first aspect of this application andthe first to the fourth implementations of the first aspect, in a fifthimplementation of the first aspect of this application, in response tothe third operation, the mobile terminal may further execute thefollowing procedure: skipping displaying, by the mobile terminal on therecycle bin screen of the first application, a file that is the same asthe first file and that is stored on a cloud server.

In this embodiment, the mobile terminal skips displaying the file thesame as the first file on the recycle bin screen, so as to avoidrepeated displaying and thereby improve user experience.

With reference to any one of the first aspect of this application andthe first to the fifth implementations of the first aspect, in a sixthimplementation of the first aspect of this application, after generatingthe second data table, the mobile terminal may display a selectionscreen. The user enters a seventh operation on the selection screen toselect a file that needs to be displayed on the recycle bin screen. Inresponse to the operation, the mobile terminal displays, on the recyclebin screen of the first application, the first file selected by theuser. For files not selected by the user, these files may be permanentlydeleted from the mobile terminal.

In this embodiment, after application data is cleared, the mobileterminal may determine, based on a selection of the user, a file thatneeds to be displayed in the recycle bin, thereby improving flexibilityof the solution.

With reference to any one of the first aspect of this application andthe first to the sixth implementations of the first aspect, in a seventhimplementation of the first aspect of this application, in response tothe second operation, the mobile terminal may further execute thefollowing procedures: changing, by the mobile terminal, a storagelocation of the first file from a first directory to a second directory,and changing a filename of the first file from a first name to a secondname, where the second directory is used to store a file displayed onthe recycle bin screen of the first application. After the mobileterminal changes the storage location of the first file from the firstdirectory to the second directory, the mobile terminal can display thefirst file on the recycle bin screen.

This embodiment provides a specific manner of displaying the first fileon the recycle bin screen by the mobile terminal, improving feasibilityof the solution.

With reference to the seventh implementation of the first aspect of thisapplication, in an eighth implementation of the first aspect of thisapplication, the second name is a target character string obtained byencoding the metadata of the first file by using a preset coding scheme.

This embodiment provides a manner in which the mobile terminal may storethe metadata of the first file in the second name by using the presetcoding scheme, providing a manner of storing the metadata after themobile terminal obtains a delete instruction, and improving feasibilityof the solution.

With reference to the eighth implementation of the first aspect of thisapplication, in a ninth implementation of the first aspect of thisapplication, the mobile terminal may specifically generate the seconddata table in the following manner: obtaining, by the mobile terminal,the metadata of the first file by decoding the second name by using thepreset coding scheme, and generating the second data table based on themetadata obtained through decoding.

This embodiment provides a manner of generating the second data table,improving feasibility of the solution.

With reference to the seventh implementation of the first aspect of thisapplication, in a tenth implementation of the first aspect of thisapplication, the second name is the deletion time of the first file; andin the process of changing, by the mobile terminal, the storage locationof the first file from the first directory to the second directory, themobile terminal further executes the following procedures: obtaining atarget character string by encoding the metadata of the first file byusing a preset coding scheme, and storing the target character stringand the deletion time of the first file in correspondence in a binaryfile of the second directory.

This embodiment provides another manner of storing the metadata afterthe mobile terminal obtains a delete instruction, improving flexibilityof the solution.

With reference to the tenth implementation of the first aspect of thisapplication, in an eleventh implementation of the first aspect of thisapplication, the mobile terminal may generate the second data table inthe following manner: determining the deletion time of the first filebased on the second name, determining the target character stringcorresponding to the deletion time in the binary file, obtaining themetadata of the first file by decoding the target character string byusing the preset coding scheme, and generating the second data tablebased on the metadata obtained through decoding.

This embodiment provides another manner of generating the second datatable, improving flexibility of the solution.

With reference to the first aspect of this application and the first tothe sixth implementations of the first aspect, in a twelfthimplementation of the first aspect of this application, before deletingthe first data table, the mobile terminal may back up the first datatable to obtain a third data table; and after deleting the first datatable, the mobile terminal generates the second data table based on thethird data table.

This embodiment provides another manner of generating the second datatable, improving flexibility of the solution.

A second aspect of this application provides a mobile terminal. Themobile terminal includes: a touchscreen, where the touchscreen includesa touch-sensitive surface and a display screen; one or more processors;a memory; a plurality of application programs; and one or more computerprograms, where the one or more computer programs are stored in thememory, the one or more computer programs include an instruction, andwhen the instruction is executed by the mobile terminal, the mobileterminal performs the following steps: obtaining a first operationentered by a user, and in response to the first operation, displaying afirst file on a first screen of a first application, obtaining a secondoperation entered by the user on the first screen, in response to thesecond operation, skipping displaying the first file on the first screenof the first application, and displaying the first file on a recycle binscreen; deleting a first data table of the first application, where thefirst file is invisible to the user on the recycle bin screen of thefirst application due to deletion of the first data table, that is, thefirst file cannot be displayed on the recycle bin screen; and after thefirst data table is deleted, obtaining a third operation entered by theuser, and in response to the third operation, generating a second datatable, where the first file is visible to the user on the recycle binscreen of the first application due to deletion of the second datatable, that is, the first file can be displayed on the recycle binscreen.

The first data table and the second data table are recycle bin datatables, and are used to record metadata of a file belonging to a recyclebin. The first application displays, based on the recycle bin datatables, the file belonging to the recycle bin. The first data table isoriginally stored on the mobile terminal, and the second data table isgenerated after the first data table is deleted. Types of metadatarecorded in the two data tables may be the same or different.

With reference to the second aspect of this application, in a firstimplementation of the second aspect of this application, before thesecond operation entered by the user on the first screen is obtained,the first file belongs to a first album of the first application; andafter the second operation entered by the user on the first screen isobtained, the first file belongs to a recycle bin album of the firstapplication; and after generating the second data table, the mobileterminal further performs the following steps: displaying the first fileon the recycle bin screen; obtaining a fourth operation, entered by theuser on the recycle bin screen, for recovering the first file; inresponse to the fourth operation, changing an album to which the firstfile belongs from the recycle bin album to a target album; anddisplaying the first file on a screen corresponding to the target album.

The target album is a system- or user-specified album, and is used bythe user to manage a multimedia file recovered on the recycle binscreen.

With reference to the second aspect of this application, in a secondimplementation of the second aspect of this application, before thesecond operation entered by the user on the first screen is obtained,the first file belongs to a first album of the first application; andafter the second operation entered by the user on the first screen isobtained, the file belongs to a recycle bin album of the firstapplication; and after generating the second data table, the mobileterminal further performs the following steps: displaying the first fileon the recycle bin screen; and obtaining a fourth operation, entered onthe recycle bin screen, for recovering the first file; in response tothe fourth operation, changing an album to which the first file belongsfrom the recycle bin album to a first album; and displaying the firstfile on a screen corresponding to the first album.

With reference to the second aspect of this application, in a thirdimplementation of the second aspect of this application, aftergenerating the second data table, the mobile terminal further performsthe following steps: displaying the first file on the recycle bin screenof the first application; and obtaining a fifth operation, entered onthe recycle bin screen, for permanently deleting the first file; and inresponse to the fifth operation, permanently deleting the first file,that is, deleting the first file from the mobile terminal, where thefirst file is no long stored on the mobile terminal after beingpermanently deleted.

With reference to the second aspect of this application, in a fourthimplementation of the second aspect of this application, aftergenerating the second data table, the mobile terminal further executesthe following procedures: displaying the first file on the recycle binscreen of the first application; and obtaining a sixth operation,entered by the user on the recycle bin screen, for viewing metadata ofthe first file, and in response to the sixth operation, displaying themetadata of the first file, where the metadata includes at least one ofthe following: an original filename of the first file, an original fileidentifier of the first file, a deletion time of the first file, asource storage path of the first file, a current storage path of thefirst file, a date taken time of the first file, a picture orientationof the first file, a cloud globally unique identifier of the first file,a hash value of the first file, and a cloud identifier of a source albumto which the first file belongs.

The original filename is a filename of the first file before theprocessor obtains the second operation. The original file identifier isan identifier, in a corresponding data table, of the first file beforethe processor obtains the second operation. The source storage path is astorage path of the first file before the processor obtains the secondoperation. The current storage path is a storage path of the first filewhen the processor obtains the sixth operation. The source album is analbum to which the first file belongs before the processor obtains thesecond operation.

With reference to any one of the second aspect of this application andthe first to the fourth implementations of the second aspect, in a fifthimplementation of the second aspect of this application, the mobileterminal may further perform the following step: skipping displaying, onthe recycle bin screen of the first application, a file that is the sameas the first file and that is stored on a cloud server.

With reference to any one of the second aspect of this application andthe first to the fifth implementations of the second aspect, in a sixthimplementation of the second aspect of this application, aftergenerating the second data table, the mobile terminal may furtherperform the following steps: displaying a selection screen; andobtaining a seventh operation entered by the user on the selectionscreen, and in response to the seventh operation, displaying the firstfile selected by the user on the recycle bin screen of the firstapplication, where for files not selected by the user, these files maybe permanently deleted.

With reference to any one of the second aspect of this application andthe first to the sixth implementations of the second aspect, in aseventh implementation of the second aspect of this application, inresponse to the second operation, the processor may further execute thefollowing procedures: changing a storage location of the first file froma first directory to a second directory, and changing a filename of thefirst file from a first name to a second name, where the seconddirectory is used to store a file displayed on the recycle bin screen ofthe first application. After changing the storage location of the firstfile from the first directory to the second directory, the mobileterminal can display the first file on the recycle bin screen.

With reference to the seventh implementation of the second aspect ofthis application, in an eighth implementation of the second aspect ofthis application, the second name is a target character string obtainedby encoding the metadata of the first file by using a preset codingscheme.

With reference to the eighth implementation of the second aspect of thisapplication, in a ninth implementation of the second aspect of thisapplication, the mobile terminal may generate the second data table inthe following manner: obtaining the metadata of the first file bydecoding the second name by using the preset coding scheme, andgenerating the second data table based on the metadata obtained throughdecoding.

With reference to the seventh implementation of the second aspect ofthis application, in a tenth implementation of the second aspect of thisapplication, the second name is the deletion time of the first file; andthe mobile terminal further performs the following steps: obtaining atarget character string by encoding the metadata of the first file byusing a preset coding scheme, and storing the target character stringand the deletion time of the first file in correspondence in a binaryfile of the second directory.

With reference to the tenth implementation of the second aspect of thisapplication, in an eleventh implementation of the second aspect of thisapplication, the processor may generate the second data table in thefollowing manner: determining the deletion time of the first file basedon the second name, determining the target character stringcorresponding to the deletion time in the binary file, obtaining themetadata of the first file by decoding the target character string byusing the preset coding scheme, and generating the second data tablebased on the metadata obtained through decoding.

With reference to the second aspect of this application and the first tothe sixth implementations of the second aspect, in a twelfthimplementation of the second aspect of this application, the mobileterminal may back up the first data table before deleting the first datatable, to obtain a third data table; and after deleting the first datatable, the mobile terminal generates the second data table based on thethird data table.

A third aspect of this application provides a mobile terminal, where themobile terminal includes: a display module, configured to: in responseto a first operation, display a first file on a first screen of a firstapplication; an obtaining module, further configured to obtain a secondoperation entered by a user on the first screen, where the displaymodule is further configured to: in response to the second operation,display the first file on a recycle bin screen of the first application;a deletion module, configured to delete a first data table, where thefirst file is invisible to the user on the recycle bin screen of thefirst application due to deletion of the first data table, where theobtaining module is further configured to obtain a third operationentered by the user; and a generation module, configured to: in responseto the third operation, generate a second data table, where the firstfile is visible to the user on the recycle bin screen of the firstapplication due to existence of the second data table.

With reference to the third aspect of this application, in a firstimplementation of the third aspect of this application, before theobtaining module obtains the second operation, the first file belongs toa first album of the first application; and after the obtaining moduleobtains the second operation, the file belongs to a recycle bin album ofthe first application; and after the generation module generates thesecond data table, the display module is further configured to displaythe first file on the recycle bin screen of the first application; theobtaining module is further configured to obtain a fourth operationentered by the user on the recycle bin screen; and the display module isconfigured to: in response to the fourth operation, display the firstfile on a screen corresponding to a first album of the firstapplication, where after the obtaining module obtains the fourthoperation, the first file belongs to the first album of the firstapplication.

With reference to the third aspect of this application, in a secondimplementation of the third aspect of this application, before theobtaining module obtains the second operation, the first file belongs toa first album of the first application; and after the obtaining moduleobtains the second operation, the file belongs to a recycle bin album ofthe first application; and after the generation module generates thesecond data table, the display module is further configured to displaythe first file on the recycle bin screen of the first application; theobtaining module is further configured to obtain a fourth operationentered by the user on the recycle bin screen; and the display module isfurther configured to: in response to the fourth operation, display thefirst file on a screen corresponding to a target album of the firstapplication, where after the obtaining module obtains the fourthoperation, the first file belongs to the target album of the firstapplication.

With reference to the third aspect of this application, in a thirdimplementation of the third aspect of this application, after thegeneration module generates the second data table, the display module isfurther configured to display the first file on the recycle bin screenof the first application; the obtaining module is further configured toobtain a fifth operation entered by the user on the recycle bin screen;and the deletion module is further configured to: in response to thefifth operation, delete the first file from the mobile terminal.

With reference to the third aspect of this application, in a fourthimplementation of the third aspect of this application, after thegeneration module generates the second data table, the obtaining moduleis further configured to obtain a sixth operation entered by the user,and in response to the sixth operation, display metadata of the firstfile; and the display module is further configured to: in response tothe sixth operation, display the metadata of the first file, where themetadata includes at least one of the following: an original filename ofthe first file, an original file identifier of the first file, adeletion time of the first file, a source storage path of the firstfile, a current storage path of the first file, a date taken time of thefirst file, a picture orientation of the first file, a cloud globallyunique identifier of the first file, a hash value of the first file, anda cloud identifier of a source album to which the first file belongs.

With reference to the third aspect of this application, in a fifthimplementation of the third aspect of this application, the displaymodule is further configured to: in response to the third operation,skip displaying a second file on the recycle bin screen of the firstapplication, where the second file is a file that is the same as thefirst file and that is stored on a cloud server.

With reference to the third aspect of this application, in a sixthimplementation of the third aspect of this application, after thegeneration module generates the second data table, the display module isfurther configured to display a selection screen; the obtaining moduleis further configured to obtain a seventh operation entered by the useron the selection screen; and the display module is further configuredto: in response to the seventh operation, display the first file on therecycle bin screen of the first application.

With reference to any one of the third aspect of this application andthe first to the sixth implementations of the third aspect of thisapplication, in a seventh implementation of the third aspect of thisapplication, the mobile terminal further includes: a processing module,configured to change a storage location of the first file from a firstdirectory to a second directory, and change a filename of the first filefrom a first name to a second name, where the second directory is usedto store a file displayed on the recycle bin screen of the firstapplication.

With reference to the seventh implementation of the third aspect of thisapplication, in an eighth implementation of the third aspect of thisapplication, the second name is a target character string obtained byencoding the metadata of the first file by using a preset coding scheme.

With reference to the eighth implementation of the third aspect of thisapplication, in a ninth implementation of the third aspect of thisapplication, the generation module is specifically configured to: obtainthe metadata of the first file by decoding the second name by using thepreset coding scheme, and generate the second data table based on themetadata.

With reference to the seventh implementation of the third aspect of thisapplication, in a tenth implementation of the third aspect of thisapplication, the second name is the deletion time of the first file; andthe mobile terminal further includes: a processing module, configuredto: obtain a target character string by encoding the metadata of thefirst file by using a preset coding scheme, and store the targetcharacter string and the deletion time of the first file incorrespondence in a binary file of the second directory.

With reference to the tenth implementation of the third aspect of thisapplication, in an eleventh implementation of the third aspect of thisapplication, the generation module is specifically configured to:determine the deletion time of the first file based on the second name;determine the target character string, in the second binary file,corresponding to the deletion time of the first file; obtain themetadata of the first file by decoding the target character string byusing the preset coding scheme; and generate the second data table basedon the metadata.

With reference to any one of the third aspect of this application andthe first to the sixth implementation of the third aspect of thisapplication, the mobile terminal further includes: a backup module,configured to back up the first data table to obtain a third data table,where the generation module is specifically configured to generate thesecond data table based on the third data table.

A fourth aspect of this application provides a computer readable storagemedium, including an instruction. When the instruction runs on acomputer, the computer executes the foregoing methods.

A fifth aspect of this application provides a computer program productincluding an instruction. When the computer program product runs on acomputer, the computer executes the foregoing methods.

In the embodiments of this application, after the recycle bin data tableis deleted, the mobile terminal can generate a new recycle bin datatable, so that the mobile terminal can still display the first file onthe recycle bin screen after application data is cleared, and the usercan permanently delete or recover the first file on the recycle binscreen, thereby improving user experience.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1A is a schematic diagram of a management screen of a multimediafile;

FIG. 1B is another schematic diagram of a management screen of amultimedia file;

FIG. 1C is a schematic diagram in which a user enters a deleteinstruction on a management screen of a multimedia file;

FIG. 1D is another schematic diagram in which a user enters a deleteinstruction on a management screen of a multimedia file;

FIG. 1E is a schematic diagram in which a mobile terminal moves a firstfile from a source directory to a recycle bin directory;

FIG. 1F is a schematic diagram of a multimedia file management screenafter a first file is deleted;

FIG. 1G is a schematic diagram of a recycle bin screen after a firstfile is deleted;

FIG. 1H is a schematic diagram in which a user enters, on a mobileterminal, an instruction for deleting data of a first application;

FIG. 1I is a schematic diagram of an instruction entered by a user forstarting a multimedia management application;

FIG. 1J is a schematic diagram of an operation screen corresponding to arecycle bin after application data is deleted;

FIG. 2 is a flowchart of an embodiment of a file processing methodaccording to an embodiment of this application;

FIG. 3A is a schematic diagram in which a mobile terminal moves a firstfile from a first directory to a second directory according to anembodiment of this application;

FIG. 3B is another schematic diagram in which a mobile terminal moves afirst file from a first directory to a second directory according to anembodiment of this application;

FIG. 3C is another schematic diagram in which a mobile terminal moves afirst file from a first directory to a second directory according to anembodiment of this application;

FIG. 3D is another schematic diagram in which a mobile terminal moves afirst file from a first directory to a second directory according to anembodiment of this application;

FIG. 3E is a schematic diagram of a binary file according to anembodiment of this application;

FIG. 4 is a schematic diagram of a selection screen according to anembodiment of this application;

FIG. 5A is a schematic diagram in which a mobile terminal displays afirst file on a recycle bin screen according to an embodiment of thisapplication;

FIG. 5B is another schematic diagram in which a mobile terminal displaysa first file on a recycle bin screen according to an embodiment of thisapplication;

FIG. 5C is another schematic diagram in which a mobile terminal displaysmetadata of a first file according to an embodiment of this application;

FIG. 5D is another schematic diagram in which a mobile terminal displaysmetadata of a first file according to an embodiment of this application;

FIG. 5E is another schematic diagram in which a mobile terminal displaysmetadata of a first file according to an embodiment of this application;

FIG. 6A is a schematic diagram in which a user enters a recoverinstruction on a recycle bin screen according to an embodiment of thisapplication;

FIG. 6B is another schematic diagram in which a user enters a recoverinstruction on a recycle bin screen according to an embodiment of thisapplication;

FIG. 6C is a schematic diagram in which a mobile terminal moves a firstfile from a second directory to a target directory according to anembodiment of this application;

FIG. 6D is a schematic diagram in which a mobile terminal recovers afirst file to a target album according to an embodiment of thisapplication;

FIG. 7A is a schematic diagram in which a mobile terminal moves a firstfile from a second directory to a first directory according to anembodiment of this application;

FIG. 7B is a schematic diagram in which a mobile terminal recovers afirst file to a source album according to an embodiment of thisapplication;

FIG. 8A is a schematic diagram in which a user enters a deleteinstruction on a recycle bin screen according to an embodiment of thisapplication;

FIG. 8B is a schematic diagram in which a user enters a deleteinstruction on a recycle bin screen according to an embodiment of thisapplication;

FIG. 8C is a schematic diagram in which a mobile terminal deletes afirst file from the mobile terminal according to an embodiment of thisapplication;

FIG. 9 is a schematic diagram of an embodiment of a mobile terminalaccording to an embodiment of this application; and

FIG. 10 is a schematic diagram of another embodiment of a mobileterminal according to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following describes the technical solutions in the embodiments ofthis application with reference to the accompanying drawings in theembodiments of this application. Apparently, the described embodimentsare merely some but not all of the embodiments of this application.

In the specification, claims, and accompanying drawings of thisapplication, the terms “first”, “second”, “third”, “fourth”, and so on(if any) are intended to distinguish between similar objects but do notnecessarily indicate a specific order or sequence. It should beunderstood that the data termed in such a way are interchangeable inproper circumstances so that the embodiments described herein can beimplemented in other orders than the order illustrated or describedherein. Moreover, the terms “include”, “contain” and any other variantsmean to cover the non-exclusive inclusion. For example, a process,method, system, product, or device that includes a list of steps orunits is not necessarily limited to those expressly listed steps orunits, but may include other steps or units not expressly listed orinherent to such a process, method, system, product, or device. To helpunderstanding of the embodiments of this application, the followingdescribes terms used in the embodiments of this application.

Metadata: Also referred to as intermediary data or relay data, metadatais data about data (data about data), mainly information describingproperties (property) of data, and is used to support functions such asstorage location indication, historical data, resource searching, andfile recording. Metadata is an electronic directory. For the purpose ofcompiling a directory, content or characteristics of data need to bedescribed and collected, so as to assist in data retrieval.

In the embodiments of the present invention, metadata of a picture or avideo may include one of the following: a filename extension, a filename(display name), a deletion time (recycled time), a file identifier(local media identifier), a current storage path, a source storage path(source path), a date taken time (date taken), a picture orientation(orientation), a cloud identifier of a source album (album identifier),a hash value (hash) of a file, a cloud globally unique identifier (cloudglobally unique identifier, Cloud GUID) of the file, and a photographinglocation.

The original filename is a filename of a first file before a mobileterminal obtains a second operation. The original identifier is anidentifier, in a corresponding data table, of the first file before themobile terminal obtains the second operation. The source storage path isa storage path of the first file before the mobile terminal obtains thesecond operation. The current storage path is a storage path of thefirst file when the mobile terminal obtains a sixth operation. Thesource album is an album to which the first file belongs before themobile terminal obtains the second operation.

Album: A picture management application is used to manage pictures andvideos in a mobile terminal. Some picture management applicationsclassify pictures and videos in the mobile terminal into a plurality ofgroups for management, based on how the pictures and videos areobtained. An album to which a picture or a video belongs is a group towhich the picture or the video belongs. For example, a picture and avideo downloaded from a WeChat application are classified into onegroup, both belonging to a WeChat album; and a picture and a video takenby a camera application are classified into one group, both belonging toa camera album.

A recycle bin album is a special group. A picture or a video deleted bya user in a picture management application are moved from an originalgroup to this group. In other words, an album to which the picture andthe video belong is changed from a source album to the recycle binalbum. It should be understood that in some embodiments, the recycle binalbum is also referred to as a recent delete album, a delete album, orother names. This is not specifically limited in this application.

In addition, it should be noted that in the following embodiments ofthis application, there are descriptions like “a first file belongs to afirst album of a first application”. “Belongs to” herein may be sounderstood that, after a user starts the first application (for example,an album application) and taps an album, the first file is presented inthe album. In the sense of user perception, it may be understood thatthe user sees the first file in the first album.

It should be understood that the picture management application maydisplay pictures and videos in groups by album, or display pictures andvideos by obtaining location or obtaining time.

Recycle bin: A recycle bin in the embodiments of this application refersto a group to which deleted multimedia files such as pictures and videosbelong. It should be understood that recycle bins may be classified intoa local recycle bin and a cloud recycle bin. The local recycle bin isused by a user to manage multimedia files locally deleted from a mobileterminal, and the cloud recycle bin is used by the user to managemultimedia files deleted from a cloud server. When the mobile terminalis connected to the cloud server, the user can upload a multimedia filefrom the local recycle bin to the cloud recycle bin, and may alsodownload a multimedia file from the cloud recycle bin to the localrecycle bin.

Application data: Application data in the embodiments of thisapplication is data recorded in a running process of an application. Forexample, for a communications application, application data of thecommunications application may include user account information, a chathistory, and the like; for a browser application, application data ofthe browser application may include a browse history, a search history,and the like; and for a media management application, application dataof the media management application may include a record generated in aprocess of managing a multimedia file by a user, for example, aclassification record of multimedia files by the user, a change historyof a multimedia file by the user, and metadata information correspondingto each multimedia file.

Filename extension: Also referred to as an extension of a file, afilename extension is a mechanism used for an operating system toidentify a file type. Generally, an extension follows a main filename,and is delimited from the main filename with a separator. For example,in a filename like “example.txt”, example is a filename, and txt is anextension, which indicates that this file is a pure text file.

Data table: A data table in this application is a carrier, in a mediamanagement application, that is used to record metadata of a multimediafile managed by the media management application. The media managementapplication presents the multimedia file based on the metadata recordedin the data table.

File identifier (local media identifier): A file identifier in theembodiments is an identifier of a multimedia file in a data table. Inone data table, different multimedia files are corresponding todifferent identifiers. In some embodiments of this application, originalfile identifiers are used for naming, to ensure uniqueness of filenames.The original file identifier is an identifier in a data table before asecond operation is entered by a user.

Directory: A directory in the embodiments of this application is afolder in which a multimedia file is stored on a mobile terminal. Afirst directory is a directory in which a multimedia file is storedbefore being deleted, and a second directory is a directory used tostore a multimedia file corresponding to a local recycle bin. Key-valuepair (key-value): a form of data storage. A key (key) represents anumber of a stored value, and value (value) represents data that needsto be stored. A unique corresponding value can be obtained based on akey. In this application, a target character string is used as a value,a deletion time is used as a key, and a unique corresponding targetcharacter string can be found by using the deletion time.

Base64: Base64 is one of most common coding schemes used to transmit8-bit byte codes on the Internet. Base64 is a method for representingbinary data based on 64 printable characters. A coding rule of Base64 isas follows: (1) transforming three characters into four characters; (2)adding a linefeed at every 76 characters; and (3) displaying aterminator finally.

Multimedia database: a database used to store multimedia files(including audio, videos, and pictures) in a mobile phone. When themobile phone is started, a media scanner service (Media Scanner Service)process is started to scan for multimedia files whose extension is jpgor mp4 in the mobile phone, and add information about these multimediafiles to the multimedia database. An application program on the mobilephone fetches required multimedia information from the multimediadatabase.

To facilitate the ease of managing phone memory by a user, a largequantity of mobile phones are provided with a data deletion function,and a user can delete application data and/or cache data of someapplications through system setting of the mobile phone, to release morestorage space. After the user clears, through system setting,application data of a picture management application (for example, agallery application or an album application), when the user restarts thepicture management application, the picture management applicationobtains, from the multimedia database, metadata of pictures and videosthat are stored on the mobile phone, and displays, in the picturemanagement application based on the obtained metadata, the pictures andvideos in the mobile phone.

However, for pictures and videos that are removed to a recycle binalbum, to prevent displaying by a third-party application, when thepictures and videos are removed to the recycle bin album, the picturemanagement application performs special processing on formats of thepictures and videos, for example, removing extensions such as jpg andmp4. After the user clears the application data of the picturemanagement application, when the user restarts the picture managementapplication, although the pictures and videos in the recycle bin albumare still stored in a system, because the media scanner service processis unable to find a file whose extension is not jpg or mp4, the picturemanagement application cannot obtain, from the media database, metadataof the pictures and videos in the recycle bin album, and cannotreconstruct a data table corresponding to the recycle bin album in thepicture management application. Therefore, the picture managementapplication is unable to display the pictures and videos in the recyclebin album, and is also unable to permanently delete or recover thepictures and videos in the recycle bin album. As a result, userexperience is compromised and system storage space is occupied.

The embodiments of this application disclose a file processing methodand a mobile terminal, to display a multimedia file on a recycle binscreen after application data is cleared, so that a user can permanentlydelete or recover the multimedia file on the recycle bin screen, therebyimproving user experience.

For ease of understanding of the embodiments of this application, thefollowing briefly describes a scenario that the file processing methodand the mobile terminal in this application are applicable to.

The mobile terminal in the embodiments of this application includes butis not limited to electronic devices such as a mobile phone, a tabletcomputer, an e-reader, a handheld game console, or an in-vehicleelectronic device. An operating system may be, for example, an Android,Windows Phone, BlackBerry, or iOS system. This is not specificallylimited in the embodiments of this application. It should be noted thatthe terminal in the embodiments of this application is provided with arecycle bin function.

A multimedia file in the embodiments of this application includes but isnot limited to files such as a photo, video, or audio file.

A multimedia management application in the embodiments of thisapplication may be specifically a picture management application (suchas a gallery application or an album application), or an audio filemanagement application (a recorder application or the like), or anotherapplication used to manage multimedia files. This is not specificallylimited in the embodiments of this application.

In some solutions, the mobile terminal stores some multimedia files, andthe multimedia management application is an application used to managethese multimedia files, and records metadata corresponding to thesemultimedia files by using a data table. Specifically, the multimediamanagement application supports a recycle bin function, and a data tablecorresponding to the multimedia management application includes anon-recycle-bin data table and a recycle bin data table. Thenon-recycle-bin data table is used to record metadata (for example, afilename, a storage path, a date taken time, and a picture orientation)of a multimedia file corresponding to a non-recycle-bin, and the recyclebin data table is used to record metadata (for example, a source storagepath, a deletion time, a date taken time, and a picture orientation) ofa multimedia file in a recycle bin. Table 1 is an example of thenon-recycle-bin data table, and the table records metadata of eightmultimedia files corresponding to a camera album.

TABLE 1 File Picture identi- File- Date orienta- fier name Storage pathtaken tion Location 0001 Photo Phone 20170102 90° Shenzhen 1.jpgstorage\DCIM\Camera\ 12:03 photo 1.jpg 0002 Photo Phone 20170102 90°Shenzhen 2.jpg storage\DCIM\Camera\ 12:04 photo 2.jpg 0003 Photo Phone20170102 90° Shenzhen 3.jpg storage\DCIM\Camera\ 12:20 photo 3.jpg 0004Photo Phone 20170102 90° Shenzhen 4.jpg storage\DCIM\Camera\ 12:30 photo4.jpg 0005 Video Phone 20170103 90° Guangzhou 1.mp4 storage\DCIM\Camera\11:04 video 1.mp4 0006 Photo Phone 20170105 180°  Shenzhen 5.jpgstorage\DCIM\Camera\ 09:11 photo 5.jpg 0007 Photo Phone 20170107 90°Shenzhen 6.mp4 storage\DCIM\Camera\ 10:34 photo 6.jpg 0008 Photo Phone20170107 90° Shenzhen 7.jpg storage\DCIM\Camera\ 10:35 photo 7.jpg

The mobile terminal receives an instruction for opening a multimediamanagement application, and presents a multimedia file managementscreen, as shown in FIG. 1A or FIG. 1B. A user enters a deleteinstruction on the multimedia file management screen, as shown in FIG.1C or FIG. 1D. The user selects, on the multimedia file managementscreen, a multimedia file that needs to be deleted, and then taps adelete icon to delete the selected multimedia file. After receiving thedelete instruction, the mobile terminal removes an extension of thedeleted multimedia file, moves the deleted multimedia file from a sourcedirectory to a recycle bin directory (as shown in FIG. 1E), and removesmetadata corresponding to the deleted multimedia file from anon-recycle-bin data table. A metadata-removed non-recycle-bin datatable is described in Table 2. In addition, the metadata correspondingto the multimedia file (that is, the deleted multimedia file) that ismoved to the recycle bin directory is added to a recycle bin data table.A metadata-added recycle bin data table is described in Table 3.

TABLE 2 File Picture identi- File- Date orienta- fier name Storage pathtaken tion Location 0001 Photo Phone 20170102 90° Shenzhen 1.jpgstorage\DCIM\Camera\ 12:03 photo 1.jpg 0002 Photo Phone 20170102 90°Shenzhen 2.jpg storage\DCIM\Camera\ 12:04 photo 2.jpg 0004 Photo Phone20170102 90° Shenzhen 4.jpg storage\DCIM\Camera\ 12:30 photo 4.jpg 0005Video Phone 20170103 90° Guangzhou 1.mp4 storage\DCIM\Camera\ 11:04video 1.mp4 0006 Photo Phone 20170105  0° Shenzhen 5.jpgstorage\DCIM\Camera\ 09:11 photo 5.jpg 0007 Photo Phone 20170107 90°Shenzhen 6.mp4 storage\DCIM\Camera\ 10:34 photo 6.jpg 0008 Photo Phone20170107 90° Shenzhen 7.jpg storage\DCIM\Camera\ 10:35 photo 7.jpg

TABLE 3 File Recycle Source Picture identi- bin file storage RecycledDate orienta- fier path path time taken tion Location 0001 Phone Phone20170116 20170102 90° Shenzhen storage\ storage\ 11:11:03:01 12:20 DCIM\DCIM\ Bin Camera\ photo 3.jpg

After the user enters the delete instruction on the multimedia filemanagement screen, the deleted multimedia file is not included on themultimedia file management screen presented by the mobile terminal, asshown in FIG. 1F. When the mobile terminal receives an instruction foropening a recycle bin, the mobile terminal presents the deletedmultimedia file on a screen corresponding to the recycle bin, as shownin FIG. 1G The user may recover or permanently delete the multimediafile on this operation screen.

The mobile terminal receives a clear application data instruction for amedia management application, as shown in FIG. 1H. The mobile terminalclears application data of the media management application. The clearedapplication data includes at least a non-recycle-bin data table and arecycle bin data table of the media management application.

After the mobile terminal clears the application data of the mediamanagement application, the mobile terminal receives an instruction forstarting the media management application. The instruction may bespecifically triggered by the user by tapping an application icon of thefirst application, as shown in FIG. 1I, or may be triggered by the userby tapping an interface to the first application in another application,or may be automatically triggered by the mobile terminal in a specificcondition. This is not specifically limited herein.

After the mobile terminal starts the media management application, insome solutions, the mobile terminal fetches metadata of a multimediafile in the mobile terminal from a media database, and creates a datatable of the multimedia management application based on the metadata.Because a multimedia file in a directory (for example, a BIN directoryin FIG. 1E) corresponding to the recycle bin does not include a filenameextension, a media scanner service process cannot find the multimediafile in the directory corresponding to the recycle bin. The mediadatabase does not include the multimedia file in the directorycorresponding to the recycle bin, and therefore the created data tableof the multimedia management application does not include the metadataof the multimedia file in the recycle bin data table. In this solution,after the application data of the media management application iscleared, when the media management application is restarted, and when aninstruction for opening the recycle bin is received, no multimedia filesare displayed on the recycle bin screen presented by the mobileterminal, as shown in FIG. 1J.

In this embodiment of this application, after the mobile terminalreceives a delete instruction for a multimedia file, in a process ofmoving the deleted multimedia file from a source directory to therecycle bin directory, the mobile terminal extracts and stores metadataof the deleted multimedia file, and renames the deleted multimedia file.After the application data of the media management application iscleared, the mobile terminal can reconstruct a non-recycle-bin datatable and a recycle bin data table, and then display multimedia files ina recycle bin album and a non-recycle-bin album in the media managementapplication based on the non-recycle-bin data table and the recycle bindata table.

Based on the foregoing example scenario, the following describes indetail a process of renaming a multimedia file and reconstructing arecycle bin data table by a mobile terminal in an embodiment of thisapplication. Referring to FIG. 2 , an embodiment of a file processingmethod in this embodiment of this application includes the followingsteps.

-   -   201. A mobile terminal obtains a first operation entered by a        user, and in response to the first operation, displays a first        file on a first screen of a first application; and a user taps        an icon of the first application, and in response to the        operation, the mobile terminal starts the first application, and        displays the first file on the first screen of the first        application. The first application is a multimedia management        application, and the first screen is a management screen of a        multimedia file. The management screen can provide functional        buttons for operations such as edit, delete, and classify for a        multimedia file. The first screen may be a management screen for        a plurality of multimedia files (including the first file), as        shown in FIG. 1A, or a management screen for the first file, as        shown in FIG. 1B. This is not specifically limited herein.    -   202. The mobile terminal obtains a second operation entered by        the user on the first screen, and in response to the second        operation, displays the first file on a recycle bin screen of        the first application.

Specifically, the second operation may be a single delete instructionfor a first file, as shown in FIG. 1C or FIG. 1D, or a batch deleteinstruction for a plurality of first files. For example, in a scenarioshown in FIG. 1C, the user may select a plurality of multimedia files,and taps a delete icon to initiate a delete instruction for theplurality of multimedia files. This is not specifically limited herein.

After receiving the delete instruction, the mobile terminal moves thefirst file from a first directory to a second directory, that is,changes a storage location of the first file from the first directory tothe second directory. The first directory is a directory in which thefirst file is stored before the user enters the delete instruction. Thesecond directory is a directory used to store a file displayed on therecycle bin screen. In a process of moving the first file from the firstdirectory to the second directory, the mobile terminal renames the firstfile, that is, changes a filename of the first file from a first name toa second name, and also extracts and stores metadata of the first file.

It should be noted that, after the mobile terminal moves the first fileto the second directory, the mobile terminal can display the first fileon the recycle bin screen of the first application. As shown in FIG. 1Gthe user selects a recycle bin album from an album selection screen ofthe first application, and the mobile terminal displays the recycle binscreen according to the instruction, where the screen includes athumbnail corresponding to the first file. It should be understood thatthe instruction for opening the recycle bin screen is not limited to aform shown in FIG. 1G and a display form of the first file on therecycle bin screen is also not limited to a form shown in FIG. 1G.

Specifically, in this application of this embodiment, the metadataextracted by the mobile terminal needs to include at least a filenameextension of an original filename of the first file. Specifically,according to a degree of recovery, the metadata extracted by the mobileterminal may further include one or more of the following: a mainfilename of the original filename (the first name), an original fileidentifier, a deletion time, a recycle bin file path, a source storagepath of the first file, a date taken time, a picture orientation, acloud identifier of a source album to which the first file belongs, ahash value of the first file, and a cloud globally unique identifier ofthe first file. The extracted metadata may be stored in the second nameof the first file, may be stored in a binary file newly created in thesecond directory, or may be stored in other storage space. This is notspecifically limited in this embodiment.

It should be understood that the original file identifier is a fileidentifier of the first file in a non-recycle-bin data table before thefirst file is deleted. The recycle bin file path is a storage pathcorresponding to a multimedia file displayed on the recycle bin screen.The source storage path is a location in which the first file is storedbefore the first file is deleted. The cloud identifier of the sourcealbum to which the first file belongs is an album identifier, in a cloudserver, of the album to which the first file belongs before the firstfile is deleted. The cloud globally unique identifier of the first fileis an identifier of the first file in the cloud server.

The following describes several storage manners thereof.

Manner 1. In the process of moving the first file from the firstdirectory to the second directory, the mobile terminal generates arandom number, splices the extracted metadata and the random number toobtain a character string, and uses the character string as a filename(the second name) of the first file in the second directory, that is,stores the metadata and the random number in combination. The extractedmetadata of the mobile terminal is a filename extension of the firstname. For example, a random number generated by the mobile terminal is“4531265”, and a filename (the first name) of the first file in thefirst directory is “photo 3.jpg”. The mobile terminal extracts afilename extension “jpg” of the first file, and splices the filenameextension and the random number to obtain a character string“jpg4531265”. The mobile terminal renames the first file as“jpg4531265”.

Manner 2. In the process of moving the first file from the firstdirectory to the second directory, the mobile terminal encodes theextracted metadata by using a preconfigured coding scheme to obtain atarget character string, sets the target character string as a filename(the second name) of the first file in the second directory, that is,stores the single piece of metadata in the second name through encoding.The metadata extracted by the mobile terminal is the filename of thefirst file in the first directory, that is, the original filename. Ascenario corresponding to FIG. 1C or FIG. 1D is used as an example fordescription. The original filename (the first name) of the first file is“photo 3.jpg”, a target character string “55u454mHMy5qcGc=” is obtainedby using Base64 coding, and the mobile terminal renames the first fileas “55u454mHMy5qcGc=”.

Manner 3. In a process of moving the first file from the first directoryto the second directory, a character string obtained by splicing aplurality of pieces of extracted metadata is used as a filename (thesecond name) of the first file in the second directory, that is, theplurality of pieces of spliced metadata is stored in the second name.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 3 are the original filenameof the first file and the original file identifier of the first file.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 3 are the original filenameof the first file and the deletion time of the first file.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 3 are the original filenameof the first file, the original file identifier of the first file, andthe deletion time of the first file.

The following uses a scenario corresponding to FIG. 1C or FIG. 1D as anexample for description. The original filename (the first name) of thefirst file is “photo 3.jpg”, the original file identifier is “0003”, andthe deletion time is “20170116”. A character string obtained by splicingthe three pieces of metadata by the mobile terminal is “0003 photo 3.jpg20170116”. The mobile terminal renames the first file as “0003 photo3.jpg 20170116”, as shown in FIG. 3A.

Manner 4. In a process of moving the first file from the first directoryto the second directory, the mobile terminal may first splice aplurality of extracted metadata to obtain a character string, encodesthe character string by using a preconfigured coding scheme to obtain atarget character string, and uses the target character string as afilename (the second name) of the first file in the second directory,that is, stores the plurality of spliced metadata in the second namethrough encoding. The preconfigured coding scheme may include Base64 orother schemes, and this is not specifically limited herein.

Optionally, in this embodiment, before using the preconfigured codingscheme to encode the character string obtained through splicing, themobile terminal may first compress the character string, and thenencodes the compressed character string to obtain the target characterstring.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 4 are the original filenameof the first file and the original file identifier of the first file.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 4 are the original filenameof the first file and the deletion time of the first file.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 4 are the original filenameof the first file, the original file identifier of the first file, andthe deletion time of the first file.

In the example corresponding to manner 3, after the mobile terminalobtains the character string “0003 photo 3.jpg 20170116” by splicing thethree pieces of metadata, the mobile terminal obtains a target characterstring “MDAwM+ebuOeJhzMuanBnMjAxN+W5tDHmnIgxNuaXpQ==” by using Base64coding, and the mobile terminal renames the first file as“MDAwM+ebuOeJhzMuanBnMjAxN+W5tDHmnIgxNuaXpQ==”, as shown in FIG. 3B.

It should be noted that the mobile terminal restricts a length of afilename. In manner 4, if the extracted metadata includes the originalfilename (the first name) of the first file, and the filename isuser-editable, when the original filename has a relatively longcharacter length, a character string length of a character stringobtained through splicing or a target character string obtained throughencoding may exceed a length limit of the mobile terminal. In this case,in a process of obtaining a character string through splicing, themobile terminal may remove an end part of a main filename in theoriginal filename, so that the character string length of the characterstring obtained through splicing or the target character string obtainedthrough encoding does not exceed the length limit. For example, inAndroid (Android), it can be learnt from a Base64 coding rule that acharacter length ratio of a Base64-encoded character string to anoriginal character string is 4:3. However, an Android-based mobile phonecan support a maximum of 256 bytes in a character string length of afilename. To ensure that the Base64-encoded character string does notexceed this length (256 bytes), before being encoded, a character stringshould not exceed 192 bytes. In other words, the character stringobtained through splicing should not exceed 192 bytes. The originalfilename (the first name) of the first file is “I am taking photos withMom in front of our housewozaitianmnenhemamayiqipaizhaowozaitiananmenhemamayiqipaizhaowozaitianammenhemamayiqipaizhaowozaitianmnenhemamayiqipaizhaowozaitianmnenhemamayiqipaizhaoasaaaanjkhkjhkjh.jpg”, the original file identifier of the first file is “0003”,and the deletion time of the first file is “20170116 11:11:03”. A lengthof a character string obtained by splicing the three pieces of dataexceeds 192 bytes, and the mobile terminal removes an end part of a mainname of the original filename to obtain “I am taking photos with Mom infront of our house”, and then splices the truncated filename, theoriginal file identifier, and the deletion time to obtain a characterstring “0003 I am taking photos with Mom at Tiananmen.jpg 2017011611:11:03”, where a length of this character string is less than 192bytes. Then the character string is encoded by using the Base64 codingscheme to obtain a target character string with a length less than 256bytes.

Manner 5. In the process of moving the first file from the firstdirectory to the second directory, the mobile terminal may first splicea plurality of extracted metadata to obtain a character string, and thenencodes the character string by using a preconfigured coding scheme toobtain a target character string. If a character length of the targetcharacter string does not exceed a system length limit, the mobileterminal determines the target character string as the filename (thesecond name) of the first file in the second directory. If a characterlength of the target character string exceeds a system length limit, ina key-value (key-value) manner, the mobile terminal uses the targetcharacter string as a value (value), uses a deletion time in themetadata as a key (key), stores the value and the key in a binary filenewly created in the second directory, and determines the deletion timeas the filename (the second name) of the first file in the seconddirectory.

Optionally, in this embodiment, before encoding the character stringobtained through encoding by using the preconfigured coding scheme, themobile terminal may first compress the character string, and thenencodes the compressed character string to obtain the target characterstring.

Optionally, in this embodiment, values (that is, target characterstrings) and keys (that is, deletion times) that are corresponding to aplurality of files may all be stored in a same binary file. A filenameof the binary file may be defined in any way, and this is not limited inthis embodiment. A file type (that is, a filename extension) of thebinary file may be xml, txt, bin, or other extensions, and this is notspecifically limited in this embodiment either.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 5 are the deletion time, therecycle bin file path, the source storage path, the date taken time, andthe picture orientation.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 5 are the deletion time, therecycle bin file path, the source storage path, the date taken time, thepicture orientation, and the cloud globally unique identifier.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 5 are the deletion time, therecycle bin file path, the source storage path, the date taken time, thepicture orientation, the cloud identifier of the source album, and thehash value.

Optionally, in some embodiments, the plurality of pieces of metadataextracted by the mobile terminal in manner 5 are the deletion time, therecycle bin file path, the source storage path, the date taken time, thepicture orientation, the cloud identifier of a source album, the hashvalue, and the cloud globally unique identifier.

The following uses a scenario corresponding to FIG. 1C or FIG. 1D as anexample for description. Of a deleted multimedia file (the first file),a deletion time is “20170116 11:11:03:01”, a recycle bin file path is“Phone storage\DCIM\Bin”, a source storage path is “Phonestorage\DCIM\Camera\photo 3.jpg”, a date taken time is “20170102 12:20”,and a picture orientation is “90°”. A character string “Phonestorage\DCIM\Bin Phone storage\DCIM\Camera\photo 3.jpg 2017011611:11:03:01 20170102 12:20 90°” is obtained by splicing the foregoingmetadata, and then the character string is encoded by using Base64 toobtain a target character string “50mL5py65a2Y5YKoX . . . (the followingcharacters are omitted). A character length of the target characterstring is less than 255 bytes, and therefore the mobile terminaldetermines the target character string as the second name, as shown inFIG. 3C.

The following uses another scenario as an example for description. Of adeleted multimedia file (the first file), a deletion time is “2017011611:11:03:01”, a recycle bin file path is “Phone storage\DCIM\Bin”, asource storage path of the first file is “Phonestorage\DCIM\Camera\photo 3.jpg”, a date taken time is “20170102 12:20”,a picture orientation is “90°”, a cloud identifier of the source albumis “464135132428731234534”, a hash value is“8a21589c6ac2413295d41d8955bbdcc1asdaa3542alsd21a2sdlasd3sa56hth41464h131rD”,and a cloud globally unique identifier of the first file is“6F9619FF-8B86-D011-B42D-00C04FC964FF”. A character string is obtainedby splicing these pieces of metadata, and a target character string (acharacter length of the target character string in this example isrelatively long, and therefore the target character string is notpresented herein. For ease of description, an “A” is used to representthe target character string) is obtained by using Base64 coding. Alength of the target character string “A” exceeds 255 bytes, and themobile terminal stores the target character string as a value in abinary file, stores the deletion time “20170116 11:11:03:01” as a keycorresponding to the value in a binary file that is newly created in thesecond directory, as shown in FIG. 3E, and renames the first file as“20170116 11:11:03:01”, as shown in FIG. 3D.

Manner 6: In this embodiment, the mobile terminal backs up a recycle bindata table (a first data table) to obtain a third data table. The thirddata table may be stored in another directory different from a directorycorresponding to the first application, and when the mobile terminalclears application data of the first application, the third data tableis not deleted.

Specifically, after receiving a delete instruction, the mobile terminaldeletes metadata of the first file from the non-recycle-bin data table,adds the metadata corresponding to the first file to the recycle bindata table, and backs up all the metadata corresponding to the firstfile in the recycle bin data table to a second data table. To bespecific, in the process of moving the first file from the firstdirectory to the second directory, the mobile terminal stores, in thethird data table, all the metadata corresponding to the first file inthe recycle bin data table.

It should be understood that, after the mobile terminal receives thedelete instruction, in addition to the foregoing manner, the mobileterminal may alternatively store the metadata of the first file inanother manner, and may alternatively rename the first file in anothermanner. This is not specifically limited in this embodiment of thisapplication.

It should also be understood that, the procedures of extracting andsorting the metadata and renaming the second file by the mobile terminalmay be executed in the process of moving the first file from the firstdirectory to the second directory, may be executed before the first fileis moved from the first directory to the second directory, or may beexecuted after the first file is moved from the first directory to thesecond directory. This is not specifically in this application.

-   -   203. The mobile terminal deletes a first data table.

The mobile terminal obtains a clear application data instruction for thefirst application, and deletes application data of the firstapplication. The application data includes a recycle bin data table (thefirst data table). Specifically, the clear application data instructionmay be triggered by an operation entered by the user on a screen of themobile terminal, as shown in FIG. 1H, or may be automatically triggeredwhen an error occurs on an operating system or the first application.This is not specifically limited herein.

-   -   204. The mobile terminal obtains a third operation entered by        the user, and in response to the third operation, generates a        second data table.

After the mobile terminal deletes the application data of the firstapplication, when receiving an instruction for starting the firstapplication, the mobile terminal generates the second data table basedon the stored metadata. Generating the second data table may beconstructing a new recycle bin data table or recovering the deletedrecycle bin data table.

Specific to different storage locations of metadata, the mobile terminalmay construct the recycle bin data table in different manners. Thefollowing describes several of these manners.

Manner 1. The mobile terminal parses a filename of the first file (thatis, the second name of the first file) in the second directory, toobtain metadata of the first file, and the mobile terminal constructs arecycle bin data table based on the metadata.

The following uses an example for description. A filename of the firstfile in the second directory is “0003 photo 3.jpg 20170116”, as shown inthe right diagram of FIG. 3A. The mobile terminal parses the filename ofthe first file to obtain an original filename “photo 3.jpg” and arecycled date “20170116”, where a constructed recycle bin data table isdescribed in Table 4.

TABLE 4 File identifier Source filename Deletion time 0001 Photo 3.jpg20170116

Manner 2. The mobile terminal decodes the filename of the first file inthe second directory by using the Base64 coding scheme to obtainmetadata of the first file, and then constructs the recycle bin datatable based on the metadata.

The following uses a filename shown in the right diagram of FIG. 3B asan example for description. A filename of the first file in the seconddirectory is “MDAwM+ebuOeJhzMuanBnMjAxN+W5tDHmnIgxNuaXpQ==”. The mobileterminal decodes the target character string by using Base64 coding toobtain a character string “0003 photo 3.jpg 20170116”, and parses thecharacter string to obtain an original filename “photo 3.jpg” of thefirst file and a recycled date “20170116” of the first file. Aconstructed recycle bin data table is shown in Table 4.

The following uses a filename shown in the right diagram of FIG. 3C asan example for description. A filename of the first file in the seconddirectory is “50mL5py65a2Y5YKoX . . . (the character string isrelatively long, and therefore following characters are omittedherein)”. The mobile terminal decodes the target character string byusing Base64 coding to obtain a character string “Phone storage\DCIM\BinPhone storage\DCIM\Camera\photo 3.jpg 20170116 11:11:03:01 2017010212:20 90°”, and parses the character string to obtain a recycle bin path“Phone storage\DCIM\Bin”, a source storage path “Phonestorage\DCIM\Camera\photo 3.jpg” of the first file, a deletion time“20170116 11:11:03:01” of the first file, a date taken time “2017010212:20” of the first file, and a picture orientation “90°” of the firstfile. A constructed recycle bin data table is described in Table 5.

TABLE 5 File Recycle Source Picture identi- bin storage Recycled Dateorienta- fier path path time taken tion 0001 Phone Phone 2017011620170102 90° storage\ storage\DCIM\ 11:11:03:01 12:20 DCIM\Bin Camera\photo 3.jpg

Manner 3. The mobile terminal determines whether the filename of thefirst file in the second directory is a timestamp, that is, determineswhether a format of the filename is a time format. If the filename isnot in a time format, the mobile terminal decodes the filename of thefirst file in the second directory by using the Base64 coding scheme toobtain metadata of the first file. If the filename is in a time format,the mobile terminal reads data from a binary file newly created in thesecond directory, searches for a target character string matching thefilename (the deletion time) of the first file, decodes the targetcharacter string by using the Base64 coding scheme to obtain metadata ofthe first file, and constructs a recycle bin data table based on themetadata.

The following uses a filename shown in the right diagram of FIG. 3D asan example for description. A filename of the first file in the seconddirectory is “20170116 11:11:03:01”. The mobile terminal determines thatthe filename is a timestamp, and the mobile terminal reads data from abinary file newly created in a second directory, and determines that atarget character string in the binary file that is corresponding to“20170116 11:11:03:01” is “A”, as shown in FIG. 3E. The mobile terminaldecodes the target character string “A” by using the Base64 codingscheme to obtain a character string “Phone storage\DCIM\Bin Phonestorage\DCIM\Camera\photo 3.jpg 20170116 11:11:03:01 20170102 12:203sa56hth41464h131rD6F9619FF-8B86-D011-B42D-00C04FC964FF”. The mobileterminal parses the character string to obtain a recycle bin file “Phonestorage\DCIM\Bin”, a source storage path “Phonestorage\DCIM\Camera\photo 3.jpg” of the first file, a deletion time “jpg20170116 11:11:03:01” of the first file, a date taken time “012017010212:20” of the first file, a picture orientation “90°” of the first file,a cloud identifier “464135132428731234534” of the source album to whichthe first file belongs, a hash value“8a21589c6ac2413295d41d8955bbdcc1asdaa3542a1sd21a2sd1asd3sa56hth41464h131r”of the first file, and a cloud globally unique identifier“D6F9619FF-8B86-D011-B42D-00C04FC964FF” of the first file. A constructedrecycle bin data table is described in Table 6.

TABLE 6 Cloud Cloud File Recycle Source Picture identifier globallyiden- bin storage Recycled Date orien- of a source Hash unique tifierpath path time taken tation album value identifier 0001 Phone Phone20170116 20170102 90° 464135132428731234534 8a21589c6ac2413295d41d8955 .. . D6F9619FF- storage\ storage\ 11:11:03:01 12:20 8B86- DCIM\ DCIM\D011-B42D- Bin Camera\ 00C04FC964FF photo 3.jpg

Manner 4. The mobile terminal determines whether the filename of thefirst file in the second directory is a timestamp, that is, determineswhether a format of the filename is a time format. If the filename isnot in a time format, the mobile terminal decodes the filename of thefirst file in the second directory by using the Base64 coding scheme,and decompresses data obtained through parsing to obtain metadata of thefirst file. If the filename is in a time format, the mobile terminalreads data from a binary file newly created in the second directory,searches for a target character string matching the filename (thedeletion time) of the first file, decodes the target character string byusing the Base64 coding scheme, decompresses data obtained throughparsing to obtain metadata of the first file, and constructs a recyclebin data table based on the metadata.

Manner 5. The mobile terminal generates the second data table based onthe third data table. The mobile terminal may specifically copy contentof the third data table to obtain the second data table, or may use thethird data table as the second data table by moving the third data tableto a directory corresponding to the first application.

It should be understood that the mobile terminal may present a selectionscreen before constructing the recycle bin data table, as shown in FIG.4 . The selection screen is used to prompt the user to select a recyclebin file that needs to be recovered and metadata that needs to berecovered, and then the recycle bin data table is constructed based onthe file and the metadata that are selected by the user on the selectionscreen. The mobile terminal may present the selection screen afterconstructing the recycle bin data table. The selection screen is used toprompt the user to select a recycle bin file that needs to be recovered,and then the file selected by the user is displayed on the recycle binscreen based on the constructed recycle bin data table. Optionally, fora recycle bin file not selected by the user, the mobile terminal mayautomatically delete the recycle bin file permanently.

After the mobile terminal generates the second data table on the recyclebin screen, when receiving an instruction for opening the recycle binscreen, the mobile terminal displays the first file on the recycle binscreen based on the second data table.

Specifically, the recycle bin screen may be a screen displaying athumbnail of the recycle bin file, as shown in FIG. 5A. The user taps anicon corresponding to a recycle bin album, and the mobile terminaldisplays a thumbnail of the first file.

The recycle bin screen may be an edit screen of the recycle bin file, asshown in FIG. 5B. The user taps a thumbnail of the first file, and themobile terminal displays an edit screen of the first file.

In this embodiment of this application, after the recycle bin data tableis deleted, the mobile terminal can generate a new recycle bin datatable, so that the mobile terminal can still display the first file onthe recycle bin screen after application data is cleared, and the usercan permanently delete or recover the first file on the recycle binscreen, thereby improving user experience.

This embodiment of this application provides a plurality of manners ofgenerating the second data table, improving flexibility of the solution.

Based on the embodiment corresponding to FIG. 2 , in some embodiments,after the mobile terminal displays the first file on the recycle binscreen, the user may enter a sixth operation on the screen, and inresponse to the sixth operation, the mobile terminal may displaymetadata of the first file. As shown in FIG. 5C, the user taps a detailsfunction key (the sixth operation) in an edit screen of the first file,and the mobile terminal displays metadata of the first file based on thesecond data table. It should be understood that, based on differenttypes of metadata included in the second data table, the mobile terminaldisplays different metadata. FIG. 5C merely shows a deletion time and anoriginal filename of the first file. Further, in some scenarios, themobile terminal may further display a current path of the first file, asource storage path of the first file, a date taken time of the firstfile, and a picture orientation of the first file, as shown in FIG. 5D.Still further, the mobile terminal may further display an albumidentifier of an album to which the first file belongs, a cloud globallyunique identifier of the first file, and a hash value of the first file,as shown in FIG. 5E.

In this embodiment, the mobile terminal may display metadata included inthe second data table, so that the user can learn details of the firstfile, thereby improving user experience.

In some embodiments, when the mobile terminal establishes a connectionto a cloud server, after the mobile terminal deletes application data,the mobile terminal automatically downloads multimedia files from thecloud server, and displays multimedia files downloaded from a cloudrecycle bin on the recycle bin screen. Among these multimedia files,there may be a file that is the same as the first file, and therefore aplurality of identical photos or a plurality of identical videos aredisplayed on the recycle bin screen.

In an optional implementation, in this embodiment, before the mobileterminal displays the first file on the recycle bin screen, if the cloudglobally unique identifier (Cloud GUID) of the first file that isincluded in the second data table is not 0, the mobile terminal mayassociate the first file and a second file corresponding to the cloudglobally unique identifier in the cloud server, and display the secondfile and the first file in fusion, that is, display only the first fileor only the second file. Specifically, the mobile terminal may notdownload the second file from the cloud server to the mobile terminal,and displays only the first file on the recycle bin screen.Alternatively, after downloading the second file from the cloud serverto the mobile terminal, the mobile terminal may select either of thefirst file and the second file for display on the recycle bin screen,thereby avoiding that the mobile terminal displays identical contentrepeatedly.

For example, in a scenario corresponding to Table 6, the cloud globallyunique identifier corresponding to the first file is“D6F9619FF-8B86-D011-B42D-00C04FC964FF”, and the mobile terminal maysearch the cloud server for a second file whose globally uniqueidentifier is “D6F9619FF-8B86-D011-B42D-00C04FC964FF”, and then displayonly the first file on the recycle bin screen, without displaying thesecond file.

This embodiment provides a manner for avoiding that the mobile terminaldisplays identical files repeatedly on the recycle bin screen, therebyimproving flexibility of the solution.

In an optional manner, in this embodiment, before the mobile terminaldisplays the first file on the recycle bin screen, if the recycle bindata table includes the cloud identifier of the source album to whichthe first file belongs and the hash value of the first file, the mobileterminal may associate the first file and the second file, in the cloudserver, that is corresponding to the hash value and the cloud identifierof the source album to which the first file belongs, and display thesecond file and the first file in fusion, that is, display only thefirst file or only the second file. Specifically, the mobile terminalmay not download the second file from the cloud server to the mobileterminal, and displays only the first file on the recycle bin screen.Alternatively, after downloading the second file from the cloud serverto the mobile terminal, the mobile terminal may select either of thefirst file and the second file for display on the recycle bin screen,thereby avoiding that the mobile terminal displays identical contentrepeatedly.

For example, in the scenario corresponding to Table 6, if the hash valueof the first file is“8a21589c6ac2413295d41d8955bbdcclasdaa3542alsd21a2sdlasd3sa56hth41464h131r”,and the cloud identifier of the source album to which the first filebelongs is “464135132428731234534”, the mobile terminal can find, in thecloud server, a second file whose hash value is consistent with the hashvalue and whose cloud identifier of a source album is consistent withthe cloud identifier of the source album, and then displays only thefirst file on the recycle bin screen, without displaying the secondfile.

This embodiment provides another manner for avoiding displayingidentical files repeatedly on the recycle bin screen, thereby improvingflexibility of the solution.

It should be noted that, after the mobile terminal displays the firstfile on the recycle bin screen, the first file may be recoveredaccording to a recover instruction entered by the user in the operationscreen. It should be understood that the first file can be recovered todifferent degrees based on different types of metadata included in thesecond data table.

In an optional implementation, the source album to which the first filebelongs is a first album. To be specific, before the user deletes thefirst file on the first screen (before the mobile terminal obtains thesecond operation entered by the user on the first screen), the firstfile belongs to the first album. If the second data table does notinclude the source storage path of the first file, the mobile terminalis unable to recover the first file to the source album. After obtaininga recover instruction, the mobile terminal recovers the first file to atarget album.

The target album is a system- or user-specified album, and is used bythe user to manage a multimedia file recovered on the recycle binscreen. Recovering the first file to the target album means changing analbum to which the first file belongs from the recycle bin album to thetarget album. The following uses a scenario corresponding to Table 4 asan example for description. The second data table includes the deletiontime of the first file and the original filename of the first file.

In this scenario, the mobile terminal receives a recover instructionentered by the user on the operation screen. As shown in FIG. 6A or FIG.6B, the user selects the first file that needs to be recovered, and tapsa recover icon to recover the first file. After receiving the recoverinstruction, the mobile terminal moves the first file from the seconddirectory to a target directory, and changes the filename of the firstfile back to the original filename (the first name), as shown in FIG.6C. The target directory is used to store a multimedia file in thetarget album. After the user enters the recover instruction on therecycle bin screen, the recovered first file is not included on therecycle bin screen presented by the mobile terminal. When the mobileterminal receives an instruction for opening the target album, themobile terminal displays the recovered first file on a screencorresponding to the target album, as shown in FIG. 6D.

In this embodiment, after application data is deleted, the mobileterminal can recover the first file to a system-specified album, therebyimproving flexibility of the solution.

In an optional implementation, the source album to which the first filebelongs is a first album. To be specific, before the user deletes thefirst file on the first screen (before the mobile terminal obtains thesecond operation entered by the user on the first screen), the firstfile belongs to the first album. If the second data table includes thesource storage path of the first file, the mobile terminal can recoverthe first file to the source album. After obtaining the recoverinstruction, the mobile terminal recovers the first file to the firstalbum, that is, changes an album to which the first file belongs fromthe recycle bin album to the first album.

The following uses a scenario corresponding to Table 5 as an example fordescription. The second data table includes the recycle bin path, thesource storage path, the deletion time, the date taken time, and thepicture orientation that are of the first file.

In this scenario, after receiving a recover instruction entered on theoperation screen by the user, the mobile terminal moves, based on thesource storage path, the first file from the second directory to thefirst directory, changes the filename of the first file back to theoriginal filename (the first name), that is, recovers the first filefrom the recycle bin directory to a source directory, as shown in FIG.7A. After the user enters the recover instruction on the recycle binscreen, the recovered first file is not included on the recycle binscreen presented by the mobile terminal. After the mobile terminalreceives an instruction for opening a source album, the mobile terminaldisplays the recovered first file in the source album, as shown in FIG.7B.

In this embodiment, after application data is deleted, the mobileterminal can recover the first file to the source album, therebyimproving flexibility of the solution.

It should be further noted that, after the mobile terminal displays thefirst file on the recycle bin screen, the mobile terminal maypermanently delete the first file according to a delete instructionentered by the user on the operation screen, that is, delete the firstfile from the mobile terminal.

As shown in FIG. 8A or FIG. 8B, the user selects, on the recycle binscreen, the first file that needs to be deleted, and taps a delete iconto delete the first file. After obtaining the operation, the mobileterminal deletes the first file from the second directory, that is,permanently deletes the first file from the mobile terminal, as shown inFIG. 8C.

In this embodiment, the mobile terminal can permanently delete the firstfile after application data is deleted, to increase available storagespace of the mobile terminal.

The foregoing describes the file processing method of this application,and the following describes the mobile terminal of this application.Referring to FIG. 9 , an embodiment of the mobile terminal in thisapplication includes: a display module 901, configured to: in responseto a first operation, display a first file on a first screen of a firstapplication; an obtaining module 902, further configured to obtain asecond operation entered by a user on the first screen, where thedisplay module 901 is further configured to: in response to the secondoperation, display the first file on a recycle bin screen of the firstapplication; a deletion module 903, configured to delete a first datatable, where the first file is invisible to the user on the recycle binscreen of the first application due to deletion of the first data table,where the obtaining module 902 is further configured to obtain a thirdoperation entered by the user; and a generation module 904, configuredto: in response to the third operation, generate a second data table,where the first file is visible to the user on the recycle bin screen ofthe first application due to existence of the second data table.

In this embodiment of this application, after a recycle bin data tableis deleted, the mobile terminal can generate a new recycle bin datatable by using the generation module 904, so that the mobile terminalcan still display the first file on the recycle bin screen afterapplication data is cleared, and the user can permanently delete orrecover the first file on the recycle bin screen, thereby improving userexperience.

Optionally, in some embodiments, before the obtaining module 902 obtainsthe second operation, the first file belongs to a first album of thefirst application; and after the obtaining module 902 obtains the secondoperation, the first file belongs to a recycle bin album of the firstapplication; and after the generation module 904 generates the seconddata table, the display module 901 is further configured to display thefirst file on the recycle bin screen of the first application; theobtaining module 902 is further configured to obtain a fourth operationentered by the user on the recycle bin screen; the display module 901 isconfigured to display, in response to the fourth operation, the firstfile on a screen corresponding to a first album of the firstapplication; and after the obtaining module 902 obtains the fourthoperation, the first file belongs to the first album of the firstapplication.

Optionally, in some embodiments, before the obtaining module 902 obtainsthe second operation, the first file belongs to a first album of thefirst application; and after the obtaining module 902 obtains the secondoperation, the first file belongs to a recycle bin album of the firstapplication; and after the generation module 904 generates the seconddata table, the display module 901 is further configured to display thefirst file on the recycle bin screen of the first application; theobtaining module 902 is further configured to obtain a fourth operationentered by the user on the recycle bin screen; and the display module901 is further configured to: in response to the fourth operation,display the first file on a screen corresponding to a target album ofthe first application; and after the obtaining module 902 obtains thefourth operation, the first file belongs to the target album of thefirst application.

Optionally, in some embodiments, after the generation module 904generates the second data table, the display module 901 is furtherconfigured to display the first file on the recycle bin screen of thefirst application; the obtaining module 902 is further configured toobtain a fifth operation entered by the user on the recycle bin screen;and the deletion module 903 is further configured to: in response to thefifth operation, delete the first file from the mobile terminal.

Optionally, in some embodiments, after the generation module 904generates the second data table, the obtaining module 902 is furtherconfigured to obtain a sixth operation entered by the user, and inresponse to the sixth operation, display metadata of the first file; andthe display module 901 is further configured to: in response to thesixth operation, display metadata of the first file, where the metadataincludes at least one of the following: an original filename of thefirst file, an original file identifier of the first file, a deletiontime of the first file, a source storage path of the first file, acurrent storage path of the first file, a date taken time of the firstfile, a picture orientation of the first file, a cloud globally uniqueidentifier of the first file, a hash value of the first file, and acloud identifier of a source album to which the first file belongs.

Optionally, in some embodiments, the display module 901 is furtherconfigured to: in response to a third operation, skip displaying asecond file on the recycle bin screen of the first application, wherethe second file is a file that is the same as the first file and that isstored on a cloud server.

Optionally, in some embodiments, after the generation module 904generates the second data table, the display module 901 is furtherconfigured to display a selection screen; the obtaining module 902 isfurther configured to obtain a seventh operation entered by the user onthe selection screen; and the display module 901 is further configuredto: in response to the seventh operation, display the first file on therecycle bin screen of the first application.

Optionally, in some embodiments, the mobile terminal further includes: aprocessing module, configured to change a storage location of the firstfile from a first directory to a second directory, and change a filenameof the first file from a first name to a second name, where the seconddirectory is used to store a file displayed on the recycle bin screen ofthe first application.

Optionally, in some embodiments, the second name is a target characterstring obtained by encoding the metadata of the first file by using apreset coding scheme; and the generation module 904 is specificallyconfigured to: obtain the metadata of the first file by decoding thesecond name by using the preset coding scheme; and generate the seconddata table based on the metadata.

Optionally, in some embodiments, the second name is the deletion time ofthe first file; and the mobile terminal further includes: a processingmodule, configured to: obtain a target character string by encoding themetadata of the first file by using a preset coding scheme, and storethe target character string and the deletion time of the first file incorrespondence in a binary file of the second directory.

Optionally, in some embodiments, the generation module 904 isspecifically configured to: determine the deletion time of the firstfile based on the second name; determine a target character string, inthe second binary file, corresponding to the deletion time of the firstfile; obtain the metadata of the first file by decoding the targetcharacter string by using the preset coding scheme; and generate thesecond data table based on the metadata.

Optionally, in some embodiments, the mobile terminal further includes abackup module, configured to back up the first data table to obtain athird data table; and the generation module 904 is specificallyconfigured to generate the second data table based on the third datatable.

It should be understood that procedures executed by the modules of themobile terminal corresponding to FIG. 9 are similar to the methodprocedures described in the embodiment shown in FIG. 2 . Details are notdescribed herein again.

The foregoing describes the mobile terminal in this application from aperspective of functional modules. The following describes the terminalin this application from a perspective of physical hardware. As shown inFIG. 10 , for ease of description, only parts related to this embodimentof the present invention are illustrated. For specific technical detailsnot disclosed, refer to the method embodiments of this application. Themobile terminal may be any terminal device, including a mobile phone, atablet computer, a PDA (Personal Digital Assistant, personal digitalassistant), a POS (Point of Sale, point of sale), an in-vehiclecomputer, or the like. For example, the terminal is a mobile phone.

FIG. 10 is a block diagram of a partial structure of a mobile phonerelated to the terminal provided by embodiments of the presentinvention. Referring to FIG. 10 , the mobile phone includes componentssuch as a radio frequency (Radio Frequency, RF) circuit 1010, a memory1020, an input unit 1030, a display unit 1040, a sensor 1050, an audiocircuit 1060, a Wireless Fidelity (wireless fidelity, Wi-Fi) module1070, a processor 1080, and a power supply 1090. Persons skilled in theart may understand that the mobile phone structure shown in FIG. 10 doesnot constitute any limitation on the mobile phone, and the mobile phonemay include more or fewer components than those shown in the figure, ora combination of some components, or different arrangements ofcomponents.

Components of the mobile phone are described in detail below withreference to FIG. 10 .

The RF circuit 1010 may be configured to receive and send information,or receive and send signals during a call, and particularly, receivedownlink information from a base station, and then send the downlinkinformation to the processor 1080 for processing. In addition, the RFcircuit 1010 sends related uplink data to the base station. Usually, theRF circuit 1010 includes but is not limited to an antenna, at least oneamplifier, a transceiver, a coupler, a low noise amplifier (Low NoiseAmplifier, LNA), a duplexer, and the like. In addition, the RF circuit1010 may also communicate with a network and another device throughradio communication. Any communication standard or protocol may be usedfor the radio communication, including but not limited to the GlobalSystem for Mobile Communications (Global System of Mobile communication,GSM), General Packet Radio Service (General Packet Radio Service, GPRS),Code Division Multiple Access (Code Division Multiple Access, CDMA),Wideband Code Division Multiple Access (Wideband Code Division MultipleAccess, WCDMA), Long Term Evolution (Long Term Evolution, LTE), e-mail,short message service (Short Messaging Service, SMS), and the like.

The memory 1020 may be configured to store software programs andmodules. The processor 1080 executes various function applications andprocesses data of the mobile phone by running the software programs andthe modules stored in the memory 1020. The memory 1020 may mainlyinclude a program storage area and a data storage area. The programstorage area may store an operating system, an application programrequired for at least one function (such as a sound playback functionand an image playback function), and the like. The data storage area maystore data that is created based on use of the mobile phone (such asaudio data and a phone book), and the like. In addition, the memory 1020may include a high-speed random access memory, or may further include anon-volatile memory, for example, at least one disk storage device, aflash memory device, or another volatile solid-state storage device.

The input unit 1030 may be configured to receive entered digit orcharacter information, and generate key signal input related to usersetting and function control of the mobile phone. Specifically, theinput unit 1030 may include a touch panel 1031 and other input devices1032. The touch panel 1031, also referred to as a touchscreen, cancollect a touch operation performed by the user on or near the touchpanel 1031 (for example, an operation performed by a user on the touchpanel 1031 or near the touch panel 1031 by using a finger, a stylus, orany other proper object or accessory), and drive a correspondingconnection device according to a preset program. Optionally, the touchpanel 1031 may include two parts: a touch detection apparatus and atouch controller. The touch detection apparatus detects a touch positionof a user, detects a signal brought by a touch operation, and transmitsthe signal to the touch controller. The touch controller receives touchinformation from the touch detection apparatus, converts the touchinformation into touchpoint coordinates, then sends the touchpointcoordinates to the processor 1080, and can receive a command sent by theprocessor 1080 and execute the command. In addition, the touch panel1031 may be implemented in a plurality of types, such as a resistivetype, a capacitive type, an infrared type, and a surface acoustic wavetype. The input unit 1031 may further include the other input devices1032 in addition to the touch panel 1030. Specifically, the other inputdevices 1032 may include but are not limited to one or more of aphysical keyboard, a function key (such as a volume control key or apower key), a trackball, a mouse, a joystick, and the like.

The display unit 1040 may be configured to display information enteredby a user or information provided for a user, and various menus of themobile phone. The display unit 1040 may include a display panel 1041.Optionally, the display panel 1041 may be configured in a form of, forexample, a liquid crystal display (Liquid Crystal Display, LCD) or anorganic light-emitting diode (Organic Light-Emitting Diode, OLED).Further, the touch panel 1031 may cover the display panel 1041. Afterdetecting a touch operation on or near the touch panel 1031, the touchpanel 1031 transfers information about the touch operation to theprocessor 1080 to determine a touch event type. Then the processor 1080provides corresponding visual output on the display panel 1041 based onthe touch event type. Although in FIG. 10 , the touch panel 1031 and thedisplay panel 1041 are used as two separate components to implementinput and input functions of the mobile phone, in some embodiments, thetouch panel 1031 may be integrated with the display panel 1041 toimplement the input and output functions of the mobile phone.

The mobile phone may further include at least one sensor 1050, forexample, a light sensor, a motion sensor, or other sensors.Specifically, the light sensor may include an ambient light sensor and aproximity sensor. The ambient light sensor may adjust luminance of thedisplay panel 1041 based on brightness of ambient light. The proximitysensor may turn off the display panel 1041 and/or backlight when themobile phone moves close to an ear. As a type of motion sensor, anaccelerometer sensor may detect values of acceleration in variousdirections (usually, there are three axes), may detect, in a staticstate, a value and a direction of gravity, and may be used for anapplication that recognizes mobile phone postures (for example, screenswitching between a landscape mode and a portrait mode, a related game,and magnetometer posture calibration), a vibration recognition-relatedfunction (for example, a pedometer and tapping), and the like. Othersensors that can be configured on the mobile phone such as a gyroscope,a barometer, a hygrometer, a thermometer, and an infrared sensor are notdescribed herein.

The audio circuit 1060, a loudspeaker 1061, and a microphone 1062 mayprovide an audio interface between a user and the mobile phone. Theaudio circuit 1060 may transmit, to the speaker 1061, an electricalsignal that is obtained through conversion of received audio data, andthe speaker 1061 converts the electrical signal into a sound signal andoutputs the sound signal. In addition, the microphone 1062 converts acollected sound signal into an electrical signal; the audio circuit 1060receives the electrical signal and converts the electrical signal intoaudio data, and outputs the audio data to the processor 1080 forprocessing; and processed audio data is sent to, for example, anothermobile phone by using the RF circuit 1010, or the audio data is outputto the memory 1020 for further processing.

Wi-Fi is a short-range wireless transmission technology. By using theWi-Fi module 1070, the mobile phone may help a user, for example,send/receive an email, browse a web page, and access streaming media.The Wi-Fi module 1070 provides wireless broadband Internet access forthe user. Although FIG. 10 shows the Wi-Fi module 1070, it can beunderstood that the Wi-Fi module 1070 is not a necessary constituent ofthe mobile phone and may be omitted as required provided that theessence of the present invention is not changed.

The processor 1080 is a control center of the mobile phone, and connectsvarious parts of the entire mobile phone by using various interfaces andlines. The processor 1080 executes various functions of the mobile phoneand processes data by running or executing the software programs and/orthe modules stored in the memory 1020, and calling data stored in thememory 1020, so as to monitor the entire mobile phone. Optionally, theprocessor 1080 may include one or more processing units. An applicationprocessor and a modem processor may be integrated into the processor1080. The application processor mainly processes an operating system, auser interface, an application program, and the like. The modemprocessor mainly processes wireless communication. It can be understoodthat the modem processor may alternatively not be integrated into theprocessor 1080.

The mobile phone further includes the power supply 1090 (for example, abattery) that supplies power to the components. The power supply may belogically connected to the processor 1080 by using a power managementsystem, so as to implement functions such as charging management,discharging management, and power consumption management by using thepower management system.

Although not shown, the mobile phone may further include a camera, aBluetooth module, and the like. Further details are not describedherein.

The steps performed by the mobile terminal in the foregoing embodimentsmay be based on the structure of the mobile terminal shown in FIG. 10 .

An embodiment of this application further provides a computer storagemedium. The computer storage medium is used to store a computer softwareinstruction for use by the terminal, and the computer softwareinstruction includes a program designed for execution of the mobileterminal.

An embodiment of this application further provides a computer programproduct. The computer program product includes a computer softwareinstruction, and the computer software instruction may be loaded byusing a processor to implement the procedure in the file processingmethod in FIG. 2 .

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement the embodiments, the embodiments may be implementedcompletely or partially in a form of a computer program product.

The computer program product includes one or more computer instructions.When the computer program instructions are loaded and executed on thecomputer, the procedures or functions according to the embodiments ofthe present invention are all or partially generated. The computer maybe a general-purpose computer, a dedicated computer, a computer network,or other programmable apparatuses. The computer instructions may bestored in a computer readable storage medium or may be transmitted froma computer readable storage medium to another computer readable storagemedium. For example, the computer instructions may be transmitted from aweb site, computer, server, or data center to another website, computer,server, or data center in a wired (for example, through a coaxial cable,an optical fiber, or a digital subscriber line (DSL)) or wireless (forexample, through infrared, radio, microwave, or the like) manner. Thecomputer readable storage medium may be any usable medium accessible bya computer or a data storage device, such as a server or a data center,integrating one or more usable media. The usable medium may be amagnetic medium (for example, a floppy disk, a hard disk, or a magnetictape), an optical medium (for example, a DVD), a semiconductor medium(for example, a solid state disk Solid State Disk, (SSD)), or the like.

It can be clearly understood by persons skilled in the art that, forconvenience and brevity of description, for a detailed working processof the foregoing system, apparatus, and unit, reference may be made to acorresponding process in the foregoing method embodiments, and detailsare not described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiments are merely examples. For example, the unit division ismerely logical function division or may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beindirect couplings or communication connections through some interfaces,apparatuses or units, and may be implemented in electrical, mechanical,or other forms.

The units described as separate parts may or may not be physicallyseparate. Parts displayed as units may or may not be physical units, andmay be located in one position or distributed on a plurality of networkunits. Some or all of the units may be selected depending on actualneeds to achieve the objectives of the solutions of the embodiments.

In addition, functional units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software functional unit.

When the integrated unit is implemented in the form of a softwarefunctional unit and sold or used as an independent product, theintegrated unit may be stored in a computer readable storage medium.Based on such an understanding, the technical solutions of thisapplication essentially, or the part contributing to the prior art, orall or some of the technical solutions may be implemented in the form ofa software product. The computer software product is stored in a storagemedium and includes several instructions for instructing a computerdevice (which may be a personal computer, a server, a network device, orthe like) to perform all or some of the steps of the methods describedin the embodiments of this application. The foregoing storage mediumincludes any medium that can store program code, such as a USB flashdrive, a removable hard disk, a read-only memory (English full name:Read-Only Memory, ROM for short), a random access memory (English fullname: Random Access Memory, RAM for short), a magnetic disk, or anoptical disc.

The foregoing embodiments are merely intended to describe the technicalsolutions of this application, but not to limit this application.Although this application is described in detail with reference to theforegoing embodiments, persons of ordinary skill in the art shouldunderstand that they may still make modifications to the technicalsolutions described in the foregoing embodiments or make equivalentreplacements to some technical features thereof, without departing fromthe spirit and scope of the technical solutions of the embodiments ofthis application.

The invention claimed is:
 1. A method implemented by a mobile terminal,wherein the method comprises: obtaining a first operation from a user;displaying, in response to the first operation, a first file on a firstscreen of a first application; obtaining a second operation from theuser on the first screen; changing, in response to the second operation,a storage location of the first file from a first directory to a seconddirectory to display the first file on a recycle bin screen of the firstapplication, wherein the second directory is configured to store one ormore files displayed on the recycle bin screen; encoding, by using apreset coding scheme, metadata of the first file to obtain a targetcharacter string; changing a filename of the first file from a firstname to a second name, wherein the second name is the target characterstring; deleting, after displaying the first file on the recycle binscreen, a first data table to remove the first file from view of theuser on the recycle bin screen; obtaining, after deleting the first datatable, a third operation from the user; obtaining, in response to thethird operation, the metadata by decoding the second name by using thepreset coding scheme; and generating, based on the metadata, a seconddata table to make the first file visible to the user on the recycle binscreen.
 2. The method of claim 1, wherein before obtaining the secondoperation, the first file belongs to a first album of the firstapplication, wherein after generating the second data table, the methodfurther comprises: displaying the first file on the recycle bin screen;obtaining a fourth operation from the user on the recycle bin screen;and displaying, in response to the fourth operation, the first file on asecond screen corresponding to the first album, and wherein the firstfile belongs to the first album after obtaining the fourth operation. 3.The method of claim 1, wherein after generating the second data table,the method further comprises: displaying the first file on the recyclebin screen; obtaining a fourth operation from the user on the recyclebin screen; and deleting, in response to the fourth operation, the firstfile from the mobile terminal.
 4. The method of claim 1, furthercomprising storing the metadata in the second data table, wherein themetadata comprises: an original filename of the first file; an originalfile identifier of the first file; a deletion time of the first file; asource storage path of the first file; a current storage path of thefirst file; a date taken time of the first file; a picture orientationof the first file; a cloud globally unique identifier of the first file;a hash value of the first file; or a cloud identifier of a source albumto which the first file belongs.
 5. A mobile terminal, comprising: oneor more processors; and a memory coupled to the one or more processorsand configured to store instructions that, when executed by the one ormore processors, cause the mobile terminal to: obtain a first operationfrom a user; display, in response to the first operation, a first fileon a first screen of a first application; obtain a second operation fromthe user on the first screen; change, in response to the secondoperation, a storage location of the first file from a first directoryto a second directory to display the first file on a recycle bin screenof the first application, wherein the second directory is configured tostore one or more files displayed on the recycle bin screen; encode, byusing a preset coding scheme, metadata of the first file to obtain atarget character string; change a filename of the first file from afirst name to a second name, wherein the second name is the targetcharacter string; delete, after displaying the first file on the recyclebin screen, a first data table to remove the first file from view of theuser on the recycle bin screen; obtain, after deleting the first datatable, a third operation from the user; obtain, in response to the thirdoperation, the metadata by decoding the second name by using the presetcoding scheme; and generate, based on the metadata, a second data tableto make the first file visible to the user on the recycle bin screen. 6.The mobile terminal of claim 5, wherein before obtaining the secondoperation, the first file belongs to a first album of the firstapplication, wherein after generating the second data table, the one ormore processors further execute the instructions to cause the mobileterminal to: display the first file on the recycle bin screen; obtain afourth operation from the user on the recycle bin screen; and display,in response to the fourth operation, the first file on a second screencorresponding to the first album, and wherein the first file belongs tothe first album after obtaining the fourth operation.
 7. The mobileterminal of claim 5, wherein before obtaining the second operation, thefirst file belongs to a first album of the first application, whereinafter generating the second data table, the one or more processorsfurther execute the instructions to cause the mobile terminal to:display the first file on the recycle bin screen; obtain a fourthoperation from the user on the recycle bin screen; and display, inresponse to the fourth operation, the first file on a second screencorresponding to a target album of the first application, and whereinthe first file belongs to the target album after obtaining the fourthoperation.
 8. The mobile terminal of claim 5, wherein after generatingthe second data table, the one or more processors further execute theinstructions to cause the mobile terminal to: display the first file onthe recycle bin screen; obtain a fourth operation from the user on therecycle bin screen; and delete, in response to the fourth operation, thefirst file from the mobile terminal.
 9. The mobile terminal of claim 5,wherein the one or more processors further execute the instructions tocause the mobile terminal to store the metadata of the first file in thesecond data table, and wherein the metadata comprises: an originalfilename of the first file; an original file identifier of the firstfile; a deletion time of the first file; a source storage path of thefirst file; a current storage path of the first file; a date taken timeof the first file; a picture orientation of the first file; a cloudglobally unique identifier of the first file; a hash value of the firstfile; or a cloud identifier of a source album to which the first filebelongs.
 10. A computer program product comprising instructions storedon a non-transitory computer-readable medium that, when executed by oneor more processors, cause a mobile terminal to: obtain a first operationfrom a user; display, in response to the first operation, a first fileon a first screen of a first application; obtain a second operation fromthe user on the first screen; change, in response to the secondoperation, a storage location of the first file from a first directoryto a second directory to display the first file on a recycle bin screenof the first application, wherein the second directory is configured tostore one or more files displayed on the recycle bin screen; encode, byusing a preset coding scheme, metadata of the first file to obtain atarget character string; change a filename of the first file from afirst name to a second name, wherein the second name is the targetcharacter string; delete, after displaying the first file on the recyclebin screen, a first data table to remove the first file from view of theuser on the recycle bin screen; obtain, after deleting the first datatable, a third operation from the user; obtain, in response to the thirdoperation, the metadata by decoding the second name by using the presetcoding scheme; and generate, based on the metadata, a second data tableto make the first file visible to the user on the recycle bin screen.11. The computer program product of claim 10, wherein before obtainingthe second operation, the first file belongs to a first album of thefirst application, wherein after generating the second data table, theone or more processors further execute the instructions to cause themobile terminal to: display the first file on the recycle bin screen;obtain a fourth operation from the user on the recycle bin screen; anddisplay, in response to the fourth operation, the first file on a secondscreen corresponding to the first album, and wherein the first filebelongs to the first album after obtaining the fourth operation.
 12. Thecomputer program product of claim 10, wherein before obtaining thesecond operation, the first file belongs to a first album of the firstapplication, wherein after generating the second data table, the one ormore processors further execute the instructions to cause the mobileterminal to: display the first file on the recycle bin screen; obtain afourth operation from the user on the recycle bin screen; and display,in response to the fourth operation, the first file on a second screencorresponding to a target album of the first application, and whereinthe first file belongs to the target album after obtaining the fourthoperation.
 13. The computer program product of claim 10, wherein aftergenerating the second data table, the one or more processors furtherexecute the instructions to cause the mobile terminal to: display thefirst file on the recycle bin screen; obtain a fourth operation from theuser on the recycle bin screen; and delete, in response to the fourthoperation, the first file from the mobile terminal.
 14. The computerprogram product of claim 10, wherein the one or more processors furtherexecute the instructions to cause the mobile terminal to store themetadata in the second data table, and wherein the metadata comprises:an original filename of the first file; an original file identifier ofthe first file; a deletion time of the first file; a source storage pathof the first file; or a current storage path of the first file.
 15. Thecomputer program product of claim 10, wherein the one or more processorsfurther execute the instructions to cause the mobile terminal to storethe metadata in the second data table.
 16. The computer program productof claim 15, wherein the metadata comprises a date taken time of thefirst file.
 17. The computer program product of claim 15, wherein themetadata comprises a picture orientation of the first file.
 18. Thecomputer program product of claim 15, wherein the metadata comprises acloud globally unique identifier of the first file.
 19. The computerprogram product of claim 15, wherein the metadata comprises a hash valueof the first file.
 20. The computer program product of claim 15, whereinthe metadata comprises a cloud identifier of a source album to which thefirst file belongs.